/**
 * Coryright 2015-2020 www.eyaomall.cn
 * All rights reserved.
 * @author tumingjun
 * @date 2016年9月21日
 *
 */

package com.eyaomall.wxmanage.service.impl;

import java.util.Date;

import org.apache.commons.lang.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eyaomall.wxmanage.dao.DepositUserDao;
import com.eyaomall.wxmanage.model.po.DepositUser;
import com.eyaomall.wxmanage.model.vo.DepositUserVO;
import com.eyaomall.wxmanage.service.DepositUserService;
import com.lycheeframework.core.cmp.kit.PageHTTPObject;
import com.lycheeframework.core.cmp.kit.Pages;

/**
 * @author tumingjun
 *
 */
@Service
public class DepositUserServiceImpl implements DepositUserService{
	
	@Autowired
	private DepositUserDao depositUserDao;
	
	
	/**
	 * 获取流水列表
	 */
	public Pages<?> page(DepositUserVO depositUserVO,PageHTTPObject httpObject) {
		
		return depositUserDao.page(depositUserVO,httpObject);
	}

	/**
	 * 添加收支记录
	 */
	public boolean insert(DepositUser depositUser) {
		String depositNo = new Date().getTime() + RandomStringUtils.randomNumeric(4);
		
		depositUser.setDepositNo(depositNo);
		depositUserDao.insert(depositUser);
		return depositUser.getId() > 0 ? true : false;
	}

}
